package com.lovo.cloud.config;

import com.google.common.hash.BloomFilter;
import com.google.common.hash.Funnels;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.nio.charset.Charset;

/**
 * @author luo
 * @description
 * @date 2020/12/8 20:03
 */
@Configuration
public class BloomConfig {

    @Bean
    public BloomFilter bloomFilter(){
        BloomFilter bloomFilter= BloomFilter.create(Funnels.stringFunnel(Charset.defaultCharset()),1000000,0.001);
        bloomFilter.put("除暴");
        return  bloomFilter;
    }

}
